<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>绿链乐购</title>
		<style>
			body {
				padding: 0;
				margin: 0;
				overflow-y: scroll;
            
			}
			
			video {
				width: 100%;
				z-index: 990;
				height: 100vh;
			}
			.video_btn {
				position: fixed;
				z-index: 999;
				top: 60px;
				right: 20px;
				width: 80px;
				height: 25px;
				line-height: 25px;
				text-align: center;
				border-radius: 15px;
				color: #fff;
                border-radius: 15px;
		        background-color: rgba(0, 0, 0, 0.4);
                
			}
            .video_btn_left{
				position: fixed;
				z-index: 999;
				top: 60px;
				left: 20px;
				height: 25px;
				line-height: 25px;
			}
            #openImg{
                width: 30px;
            }
		</style>
	</head>

	<body>
		<video style="object-fit:fill;" autoplay="autoplay" id="myvideo" poster="../../images/videobg.png" :controls="false" src="../../images/launch/ov2.mp4"></video>
		<div class="video_btn" onclick="end()">
			
			<span>跳过</span>
            <span id="time">6</span>
		</div>
        <div class="video_btn_left" onclick="closes()">
			<img src="../../images/open.png" alt="" id="openImg">
            <!-- <img src="../image/open.png" alt=""> -->
		</div>
	</body>
	<script>
		var myvideo = document.getElementById('myvideo');
		myvideo.style.height = window.screen.height;
		
            // function aa(){
            //     apiready = function() {
            //         try{
            //             setTimeout(e=>{
            //                 api.removeLaunchView({
            //                     animation: {
            //                         type: 'fade',
            //                         duration: 500
            //                     }
            //                 });
            //             },100)
            //         }catch(e){

            //         }
                    
                   
            //     }
            // }
		
		var time = 6;
		var Countdown = setInterval(function(){
			if (time == 0) {
				end();
			} else {
				time = time * 1 - 1;
				document.getElementById('time').innerHTML = time;
			}
		}, 1000);
		
		function end(){
			clearInterval(Countdown);
			api.sendEvent({
			    name: 'welcomeVideo',
			    extra: {}
			});
		}
        function closes(){
            const imgs = document.getElementById("openImg");
            const videos =  document.getElementById("myvideo");
            if(imgs.src.indexOf("open") != -1){
                imgs.src = "../../images/close.png";
                videos.muted = true;
            }else{
                imgs.src = "../../images/open.png";
                videos.muted = false;
            }
        }
	</script>

</html>